package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderDetailMapper {
    @Insert("insert into order_detail (name, image, order_id, dish_id, setmeal_id, dish_flavor, amount) VALUES " +
            "(#{name},#{image},#{orderId},#{dishId},#{setmealId},#{dishFlavor},#{amount})")
    void insert(OrderDetail orderDetail);

    @Select("select * from order_detail where order_id=#{id}")
    List<OrderDetail> getByOrderId(Long id);


    void insertBatch(List<OrderDetail> orderDetailList);


    List<GoodsSalesDTO> getTop10(LocalDateTime beginTime, LocalDateTime endTime);
}
